<?php
	
 ?>

 <html>
		<head>
    		<link rel="stylesheet" type="text/css" href="scripts/troll.css"/>
    		<title>TROLL: Players Online</title>

    		<script src="scripts/hotkeys.js" type="text/javascript"></script>
    		<script type="text/javascript">
        		shortcut.add("b",function() {window.location.assign("town.php");});
    		</script>
		</head>
		<body>
    		<center>
    		<div class="console">        
        		<table width="800" clas="console">
            		<tr>
                		<td>       
                            <p>
                                <?=hr('Player Status');?>                            
                            </p>         
                    		<table width="100%">
                                <tr><th>Name</th><th>Level</th><th>Signed On</th><th>Alive</th></tr>      
                                <?php
                                    $sql = "SELECT * FROM characters";
                                    $query = $db->query($sql);
                                    while ($p = $query->fetch())
                                    {
                                        echo '<tr>';
                                        echo '<td>'.$p['name'].'</td>
                                              <td align="center">'.$p['level'].'</td>
                                              <td align="center">'.$p['lastOn'].'</td>';
                                        if($p['dead'] == 0)
                                            echo '<td align="center">YES</td>';
                                        else
                                            echo '<td align="center">NO</td>';
                                        echo '</tr>';
                                    }
                                ?>
                            </table>                  		
							<p><a href="town.php" accesskey="B"><?=lwriteln('`8[`$B`8]`2ack to town');?></a></p>
						</td>
					</tr>	
				</table>
			</div>	
			</center>
		</body>	
		</html>	
 